Skip to content

Conversation

@emtudo
Copy link
Contributor

@emtudo emtudo commented Oct 24, 2025

This patch prevents unnecessary calls to Octane::concurrently() when the $tasks array is empty.

Without this guard, Octane sometimes triggers a misleading
TaskTimeoutException: Task timed out after 30000 milliseconds — even when there are no actual tasks to run.
This happens because Octane initializes the task pool regardless of input size, and an empty collection causes its internal wait cycle to expire.

By returning an empty array early, we:

avoid wasting resources initializing a no-op concurrent pool;

prevent false timeouts and misleading error logs;

improve the reliability of concurrency handling for cases where dynamic task lists may be empty.

…false TaskTimeoutException

This patch prevents unnecessary calls to Octane::concurrently() when the $tasks array is empty.

Without this guard, Octane sometimes triggers a misleading
TaskTimeoutException: Task timed out after 30000 milliseconds — even when there are no actual tasks to run.
This happens because Octane initializes the task pool regardless of input size, and an empty collection causes its internal wait cycle to expire.

By returning an empty array early, we:

avoid wasting resources initializing a no-op concurrent pool;

prevent false timeouts and misleading error logs;

improve the reliability of concurrency handling for cases where dynamic task lists may be empty.
@taylorotwell taylorotwell merged commit 558abf7 into laravel:2.x Oct 24, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants